using System;
using System.Collections.Generic;
using System.Text;


using System.Data;
using System.Data.Common;
using Husb.Data;
using Husb.DataUtil;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Caching;

using CentralOffice.MyTable.Data;

using DiaryComTable = CentralOffice.MyTable.Data.DiaryDataSet.diarycommentDataTable;
using DiaryComRow = CentralOffice.MyTable.Data.DiaryDataSet.diarycommentRow;
namespace CentralOffice.MyTable.DataAccess
{
    public class DiaryComAdapter : DataAccessAdapter<MyTable.Data.DiaryDataSet, DiaryComTable, DiaryComRow>
    {
        public DiaryComAdapter()
        {
            this.TableName = "diarycomment";
            DeleteStoredProc = "DiaryCom_DeleteDiaryCom";

            GetAllStoredProc = "DiaryCom_SelectDiaryComAll";
            InsertStoredProc = "DiaryCom_InsertDiaryCom";
            UpdateStoredProc = "DiaryCom_UpdateDiaryCom";
            FindStoredProc = "DiaryCom_SelectDiaryComDynamic";
            GetByIdStoredProc = "DiaryCom_SelectDiaryCom";
            GetPagedStoredProc = "DiaryCom_SelectDiaryComPaged";
            GetRowCountStoredProc = "DiaryCom_SelectDiaryComRowCount";
        }

        protected override void PopulateInsertParameters(Database db, DbCommand cmd)
        {
            db.AddInParameter(cmd, "Id", DbType.Guid, "Id", DataRowVersion.Current);
            db.AddInParameter(cmd, "DiaId", DbType.AnsiString, "DiaId", DataRowVersion.Current);
            db.AddInParameter(cmd, "UserId", DbType.AnsiString, "UserId", DataRowVersion.Current);
            db.AddInParameter(cmd, "UserName", DbType.AnsiString, "UserName", DataRowVersion.Current);
            db.AddInParameter(cmd, "ComContent", DbType.String, "ComContent", DataRowVersion.Current);
            db.AddInParameter(cmd, "SendTime", DbType.DateTime, "SendTime", DataRowVersion.Current);
            db.AddInParameter(cmd, "ReadFlag", DbType.Int32, "ReadFlag", DataRowVersion.Current);
            db.AddInParameter(cmd, "ToId", DbType.AnsiString, "ToId", DataRowVersion.Current);
            db.AddInParameter(cmd, "DeleteFlag", DbType.AnsiString, "DeleteFlag", DataRowVersion.Current);
        }
    }
}
